package com.anpy.security.repository;

import com.anpy.security.entity.Platform;
import com.anpy.security.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface UserRepository extends JpaRepository<User, Long> {
    Optional<User> findByUsername(String username);
    Optional<User> findByUsernameAndPlatform(String username, Platform platform);
    List<User> findByPlatform(Platform platform);
    boolean existsByUsername(String username);
    boolean existsByUsernameAndPlatform(String username, Platform platform);
}
